<div id="wrapper ">
    <div id="page-wrapper">
        <div class="panel panel-primary">
            <div class="panel-heading"><h5 class="panel-title"></h5></div>
            <div class="panel-body">
                <div id="toolbar" class="ms-toolbar">
                    <button id="toolbar-add" class="btn btn-danger" data-toggle="modal">
                        <span class="glyphicon glyphicon-plus"></span> 增加
                    </button>
                </div>
                <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                     aria-hidden="true">
                    <div class="modal-dialog">
                        <div id="addcategory" class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal"
                                        aria-hidden="true">&times;</button>
                                <h4 class="modal-title" id="myModalLabel">增加分类</h4>
                            </div>
                            <div class="modal-body">
                                <form id="goodsCatgoryForm" class="form-horizontal">
                                    <div class="form-group">
                                        <label for="category_name" class="col-sm-2 control-label">名称</label>

                                        <div class="col-sm-10">
                                            <input type="text" class="form-control" id="category_name"
                                                   name="category_name" placeholder="必填项，请勿使用特殊字符">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="keywords" class="col-sm-2 control-label">关键字</label>

                                        <div class="col-sm-10">
                                            <input type="text" class="form-control" id="keywords" name="keywords"
                                                   placeholder="关键字">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="parent_id" class="col-sm-2 control-label">父分类</label>

                                        <div class="col-sm-10">
                                            <select class="form-control " id="parent_id" name="parent_id"
                                                    style="width: 100%"></select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="cat_desc" class="col-sm-2 control-label">分类描述</label>

                                        <div class="col-sm-10">
                                            <input type="text" class="form-control" id="cat_desc" name="cat_desc"
                                                   placeholder="分类描述">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">分类logo</label>

                                        <div class="col-sm-10">
                                            <input id="addimg" name="file" type="file" multiple class="file-loading">
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="modal-footer">
                                <button id="close" type="button" class="btn btn-primary" data-dismiss="modal">关闭
                                </button>
                                <button id="confirm" type="button" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>cat_id</th>
                                <th>cat_name</th>
                                <th>keywords</th>
                                <th>cat_desc</th>
                                <th>parent_id</th>
                                <th>create_time</th>
                                <th>update_time</th>
                                <th>img</th>
                                <th>编辑</th>
                                <th>删除</th>
                            </tr>
                            </thead>
                            <tbody>
                            {%notempty name="$data"%}
                            {%volist name="$data" id="vo"%}
                            <tr id={%$vo.cat_id%}>
                                <td>{%$vo.cat_id%}</td>
                                <td>{%$vo.cat_name%}</td>
                                <td>{%$vo.keywords%}</td>
                                <td>{%$vo.cat_desc%}</td>
                                <td>{%$vo.parent_id%}</td>
                                <td>{%$vo.create_time |date="Y:m:d H:m:s",### %}</td>
                                <td>{%$vo.update_time |date="Y:m:d H:m:s",### %}</td>
                                <td class="chakan"><a href="{%$vo.img%}" data-lightbox="{%$vo.cat_id%}">查看</a></td>
                                <td>
                                    <button id="edit{%$vo.cat_id%}" class="btn btn-danger btn-sm catEdit">编辑</button>
                                </td>
                                <td>
                                    <button class="btn btn-danger btn-sm catDel">删除</button>
                                </td>
                            </tr>
                            {%/volist%}
                            {%/notempty%}
                            </tbody>
                        </table>
                    </div>
                    <div class="pull-right">
                        {%$data->render()%}
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>


<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div id="editcategory" class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-hidden="true">&times;</button>
                <h4 class="modal-title">编辑分类</h4>
            </div>
            <div class="modal-body">
                <form id="editCatgoryForm" class="form-horizontal">
                    <div class="form-group">
                        <label for="category_name" class="col-sm-2 control-label">ID</label>

                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="edit_category_id" name="cat_id"
                                   placeholder="必填项，请勿使用特殊字符" disabled>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="cat_name" class="col-sm-2 control-label">名称</label>

                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="edit_cat_name" name="cat_name"
                                   placeholder="必填项，请勿使用特殊字符">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="keywords" class="col-sm-2 control-label">关键字</label>

                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="edit_keywords" name="keywords"
                                   placeholder="关键字">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="parent_id" class="col-sm-2 control-label">父分类</label>

                        <div class="col-sm-10">
                            <select class="form-control " id="edit_parent_id" name="parent_id"
                                    style="width: 100%"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="cat_desc" class="col-sm-2 control-label">分类描述</label>

                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="edit_cat_desc" name="cat_desc"
                                   placeholder="分类描述">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">分类logo</label>

                        <div class="col-sm-10 center-block">
                            <input id="editimg" name="file" type="file" class="file-loading">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="edit_close" type="button" class="btn btn-primary" data-dismiss="modal">关闭
                </button>
                <button id="edit_confirm" type="button" class="btn btn-primary">提交</button>
            </div>
        </div>
    </div>
</div>


<div class="modal fade" id='deleteModal' tabindex="-1" role="dialog">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">确认删除</h4>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal">取消</button>
                <button id="delete_confirm" type="button" class="btn btn-danger">确认</button>
            </div>
        </div>
    </div>
</div>

<script src="/static/home/widget/shop/category/category.js"></script>
<script src="/static/home/widget/shop/category/editcategory.js"></script>

<!--
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                         aria-hidden="true">
                        <div class="modal-dialog">
                            <div  id="addcategory" class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal"
                                            aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="myModalLabel">增加分类</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="row msline">
                                        <form class="form-inline">
                                            <div class="form-group col-sm-6">
                                                <label for="category_name" class="">名称</label>
                                                <input type="text" class="form-control" id="category_name" name="category_name" placeholder="必填项，请勿使用特殊字符">
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <label for="en_name" class="">英文名</label>
                                                <input type="text" class="form-control" id="en_name" placeholder="请勿使用特殊字符">
                                            </div>
                                        </form>
                                    </div>
                                    <div class="row msline">
                                        <form class="form-inline">
                                            <div class="form-group col-sm-6">
                                                <label for="sort_order">排序</label>
                                                <input type="text" class="form-control" id="sort_order" placeholder="请勿使用特殊字符">
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <label for="keywords">关键字</label>
                                                <input type="text" class="form-control" id="keywords" placeholder="必填项，请勿使用特殊字符">
                                            </div>
                                        </form>
                                    </div>
                                    <div class="row msline">
                                        <form class="form-inline">
                                            <div class="form-group col-sm-6">
                                                <label for="is_show">展示</label>
                                                <input type="text" class="form-control" id="is_show" placeholder="请勿使用特殊字符">
                                            </div>
                                        </form>
                                    </div>
                                    <div class="row">
                                        <form class="form-horizontal col-sm-12" role="form" enctype="multipart/form-data">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">父分类</label>
                                                <div class="col-sm-9">
                                                    <select class="form-control " id="parent_id" style="width: 100%"></select>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">是否热门</label>
                                                <div class="col-sm-9">
                                                    <select id="is_hot" class="form-control">
                                                        <option value="1">是</option>
                                                        <option value="2">否</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                            <label class="col-sm-2 control-label">分类logo</label>
                                            <div class="col-sm-9">
                                                <input id="img" name="file" type="file" multiple class="file-loading">
                                            </div>
                                        </div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">分类描述</label>
                                                <div class="col-sm-9">
                                                    <textarea id="cat_desc" class="form-control col-md-1" rows="3" placeholder="品牌描述，请勿使用特殊字符"></textarea>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button id="close" type="button" class="btn btn-primary" data-dismiss="modal">关闭
                                    </button>
                                    <button id="confirm" type="button" class="btn btn-primary">提交</button>
                                </div>
                            </div>
                        </div>
</div>
-->


